<?php
/**
 * Unfuddle Attachment Model
 * File attachments are represented by this model.
 *
 * @package     Unfuddle
 * @subpackage  Data Models
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: Attachment.php 27 2011-01-15 10:33:26Z luke.visinoni $
 */
class Unfuddle_Model_Attachment extends Unfuddle_Model_Abstract {

    protected $_name = 'attachment';
    
    protected $_fields = array(
        'content-type' => array('type' => 'text', 'required' => false, 'read-only' => false),
        'created-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
        'filename' => array('type' => 'text', 'required' => false, 'read-only' => true),
        'id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'parent-id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'parent-type' => array('type' => 'set', 'required' => false, 'read-only' => true, 'set' => array('message', 'ticket', 'notebook', 'comment')),
        'size' => array('type' => 'text', 'required' => false, 'read-only' => true),
        'updated-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
        /**
         * When creating a new attachment, the following section must also
         * be including in order to reference the upload key you received
         * after uploading the file to the API
         * @todo This is not yet supported by Unfuddle_Model_Abstract
         */
        'upload.key' => array('type' => 'text', 'required' => false, 'read-only' => false),
    );

}